All Event Handlers
onload
EVENT HANDLER: onUnload
onUnload
= myJavaScriptCode
Event handler for
Window
The
onUnload
event handler is used to run a function or JavaScript code whenever the user exits a document. The
onUnload
event handler is used within either the <BODY> or the <FRAMESET> tag, and uses the following properties of the
Event
object:
type
- indicates the type of event
target
- indicates the target object to which the event was sent.
The following example shows the
onUnload
event handler being used to execute the 'finishOff' function:
Code:
<BODY onUnload="finishOff()">
Compare to the
onload
event handler.
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information